import { Component, Host, ChangeDetectorRef } from '@angular/core';
import { AppComponent } from '../../../app.component';
import { environment } from '../../../../environments/environment';
import { AnalyticsService } from '../../../shared/services/googleAnalytics.service';
import { GoogleAnalyticsBeacon } from '../../../shared/models/googleAnalytics.model';
import { BaseComponent } from '../../../shared/components/baseComponent/base.component';

/**
 * Research Esg Rating main component
 *
 * Author: Andrei Istrate
 * Date: 19.03.2018
 */
@Component({
    moduleId: module.id,
    templateUrl: 'researchEsgRating.component.html',
    styleUrls: ['../research.component.scss']
})
export class ResearchEsgRatingComponent extends BaseComponent {
    public readonly resourcesUrl: string = environment.resourcesUrl;
    constructor(
        @Host() private rootComponent: AppComponent, 
        private analyticsService: AnalyticsService,
        private cdRef: ChangeDetectorRef
        ) {
        super(cdRef);
    }


    ngAfterViewInit() {
        this.analyticsService.sendBeacon(new GoogleAnalyticsBeacon('ESG Rating Landing Page', 'Landing Pages', {}));
        this.rootComponent.finishLoading();
    }
}